﻿
window.onload = function() {
	var oUI = document.getElementById("listUL"); 
	var aLi = oUI.childNodes;
	var oA;
	for ( var i = 0; i < aLi.length; i++ ) {
		if ( aLi[i].tagName == "LI" && aLi[i].getElementsByTagName("ul").length ) {
			oA = aLi[i].getElementsByTagName("a")[0];	
			oA.onclick = change;
		}
	}
}

function change() {
	var oSecondDiv = this.parentNode.getElementsByTagName("ul")[0];
	if (oSecondDiv.className == "myHide") {
		oSecondDiv.className ="myShow";
	}
	else {
		oSecondDiv.className ="myHide";
	}	
}
